package com.sm.service;

import com.sm.entity.News;

import java.util.List;

public interface NewsService {

    /**
     * @return 返回所有新闻
     * @throws Exception 所有异常
     */
    public List<News> findAllNews()throws Exception;

    //查询最新几条数据
    public List<News> findNowNews(Integer limit)throws Exception;

    /**
     * @param nid 新闻id
     * @return 返回该新闻
     * @throws Exception 所有异常
     */
    public News findNewsByNid(Integer nid)throws Exception;


    /**
     * @param news 要添加的新闻
     * @throws Exception 所有异常
     */
    public void addNews(News news)throws Exception;

    /**
     * @param nid 要删除新闻的ID
     * @throws Exception 所有异常
     */
    public void deleteNews(Integer nid)throws Exception;
}
